<template>
  <div>
    <div class="banner" @click="handleBannerClick">
      <img class="banner-img" :src="bannerImg"/>
      <div class="banner-info">
        <div class="banner-title">{{this.sightName}})</div>
        <div class="banner-number"><span class="iconfont banner-icon">&#xe692;</span>{{this.bannerImgs.length}}</div>
      </div>
    </div>
    <fade-animation>
    <common-gallary :imgs="bannerImgs"
                    v-show="showGallary" @close="handleGallaryClose"></common-gallary>
    </fade-animation>
  </div>
</template>
<script>
import CommonGallary from 'common/gallary/Gallary'
import FadeAnimation from 'common/fade/FadeAnimation'
export default {
  name: 'DetailBanner',
  components: {
    FadeAnimation,
    CommonGallary
  },
  props: {
    sightName: String,
    bannerImg: String,
    bannerImgs: Array
  },
  data () {
    return {
      showGallary: false
    }
  },
  methods: {
    handleBannerClick () {
      this.showGallary = true
    },
    handleGallaryClose () {
      this.showGallary = false
    }
  }
}
</script>
<style lang="stylus" scoped>
  .banner
    position: relative
    overflow: hidden
    padding-bottom: 55%
    height: 0
    .banner-img
      width: 100%
    .banner-info
      display: flex
      position: absolute
      right: 0
      bottom: 0
      line-height: .6rem
      color: #ffffff
      left: 0
      background-image linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.8))
      .banner-title
        flex: 1
        font-size: .34rem
        padding: .1rem .2rem
      .banner-number
        padding: .1rem .4rem
        line-height: .32rem
        margin-top: .14rem
        margin-bottom .2rem
        border-radius: .2rem
        background: rgba(0,0,0,.8)
        font-size: .30rem
        height: .32rem
        .banner-icon
          padding-right: .1rem
          font-size: .30rem
</style>
